This invention relates to the field of file compression and, in particular, to methods, computer program products, and hardware products for implementing no-loss compression of image files.
Efficient storage and transmission of electronic images typically requires some sort of compression. Compression techniques are generally referred to as lossless or lossy. Lossless compression means that a resulting image is identical to its input image. Lossy compression techniques may have some variation between the resulting (or output) image and the input image. The amount of variation between the input image and the output image is determined by the quality of the compression technique. The overall amount of compression achieved is determined by the efficiency of the compression technique. Generally, lossless techniques have not achieved as high an efficiency as lossy techniques.
Examples of image compression techniques are wide and varied, but some lossless techniques use patterns of previously-coded neighboring pixels to predict and code each pixel. Typically, the four immediate and previously-coded neighbors of the current pixel are used, including a pixel immediately to the left of the current pixel, a pixel immediately above and diagonally to the left of the current pixel, a pixel immediately above the current pixel, and a pixel immediately above and diagonally to the right of the current pixel. These previously-coded neighbors are used to determine an augmented pattern of the current pixel. The augmented pattern includes a character and a label for each previously coded pixel. The character specifies the number of times the value of that previously-coded neighboring pixel is repeated in its corresponding direction. The label identifies which of the previously coded neighboring pixels are identical. A label for the current pixel is then predicted based upon a comparison of the determined probability for each label of the previously coded neighboring pixels. By considering a set of neighboring pixels in this manner, substantial computing power is required, yet at the same time, the compression efficiency of these techniques is limited. Accordingly, what is needed is an improved technique for performing lossless image compression.